var path = require('path')


var assetsMap;
try{
    assetsMap = rootRequire('public/dist/assets-map.json');
}catch (e){
    assetsMap=false;
}

module.exports = function(options,context){
    if(typeof options !== 'string'){
        return 'param after getStatic should be string'
    }
    if(options[0]=='/')options=options.substr(1);

    if($$is_dev){
        return $$config.devStaticBaseUrl+options
    }

    if(!assetsMap){
        throw new Error("fail to parse assetsMap.")
    }

    var endIndex = options.lastIndexOf('.')
    var key = options.substring(0,endIndex)
    var node = assetsMap[key]
    var jsPath = node['js'],
        cssPath = node['css'];


    //return options
}